<template>
	<view>
		<view class="box" v-if="!Istype">
			<view>二维码</view>
			<view class="box_word" @click="goerweima">网点开发码></view>
		</view>
		<view class="box" v-if="!Istype">
			<view>查看下级</view> 
			<view class="box_word" @click="goppdq">详细信息></view>
		</view>
		
		 <view class="box" v-if="Istype">
		 	<view>上级名称</view>
		 	<view class="box_word" >{{info.pname}}</view>
		 </view>
		 <view class="box" v-if="Istype">
		 	<view>兑换卡数量总量</view>
		 	<view class="box_word" >{{info.grossUsed}}</view>
		 </view>
		 
		<view class="box" v-if="Istype">
			<view>兑换卡数量已使用</view>
			<view class="box_word" >{{info.used}}</view>
		</view>
		 

		 <view class="box" v-if="Istype">
		 	<view>兑换卡数量未使用</view>
		 	<view class="box_word" >{{info.unused}}</view>
		 </view>
	</view>
</template>

<script>
	import {jxsInfogetShopInfo} from "../../../api/order.js"
	export default {
		data() {
			return {
				brandId:"",
				id:"",
				type:"",
				name:"代理管理",
				Istype:false,
				info:{
					pname:"",
					grossUsed:0,
					unused:0,
					used:0,
					 
				}
			}
		},
		onLoad(e) {
			console.log("3333333333333");
			console.log(e);
			this.brandId=e.brandId
			this.id=e.id
			this.type=e.type
		},
		onShow() {
			// 0:品牌,1:大区，2：经销商，3：门店
			if(this.type==0){
				this.name="品牌管理"
				this.Istype=false
			}else if(this.type==1){
				this.name="大区管理"
				this.Istype=false
			}else if(this.type==2){
					this.name="经销商管理"
					this.Istype=false
			}else{
					this.name="门店管理"
					this.Istype=true
					this.showmendian()
			}
				this.showmendian()
		},
		methods: {
			showmendian(){
				jxsInfogetShopInfo({id:this.id}).then(res=>{
					if(res.status!=200){
						uni.showToast({
							title:res.msg,
							icon:"none",
							duration:2000
						})
					}
					this.info=res.data
					console.log("info",this.info);
				})
			},
			goppdq(){
				uni.navigateTo({ url: '/pages/HzPages/ckxjView/ckxjView?brandId='+this.brandId});

			},
			goerweima(){
				uni.navigateTo({ url:'/pages/HzPages/erweimaView/erweimaView?id='+this.id+'&typeid='+this.type});

			},
		} 
	}
</script>

<style scoped lang="less">
	.box{

		width: 690upx;
		height: 70upx;
		margin: 0 auto;
		display: flex;
		justify-content: space-between;
		text-align: center;
		border-bottom: 1px solid rgba(0, 0, 0, 0.1);
		margin-top: 30upx;
	}
	.box_word{
		font-size: 17 upx;

		color: #0000004D;


	}
</style>
